<?php require_once('Connections/sepolwan_connect.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_mention = "-1";
if (isset($_GET['komentar'])) {
  $colname_mention = $_GET['komentar'];
}
mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_mention = sprintf("SELECT * FROM komentar_mmber WHERE komentar LIKE %s ORDER BY waktu DESC", GetSQLValueString("%" . $colname_mention . "%", "text"));
$mention = mysql_query($query_mention, $sepolwan_connect) or die(mysql_error());
$row_mention = mysql_fetch_assoc($mention);
$totalRows_mention = mysql_num_rows($mention);

$colname_kmnblog = "-1";
if (isset($_GET['komentar'])) {
  $colname_kmnblog = $_GET['komentar'];
}
mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_kmnblog = sprintf("SELECT * FROM komentar WHERE komentar LIKE %s ORDER BY waktu DESC", GetSQLValueString("%" . $colname_kmnblog . "%", "text"));
$kmnblog = mysql_query($query_kmnblog, $sepolwan_connect) or die(mysql_error());
$row_kmnblog = mysql_fetch_assoc($kmnblog);
$totalRows_kmnblog = mysql_num_rows($kmnblog);

$colname_dinding_tl = "-1";
if (isset($_GET['komentar'])) {
  $colname_dinding_tl = $_GET['komentar'];
}
mysql_select_db($database_sepolwan_connect, $sepolwan_connect);
$query_dinding_tl = sprintf("SELECT * FROM dinding_tl WHERE isi LIKE %s ORDER BY waktu DESC", GetSQLValueString("%" . $colname_dinding_tl . "%", "text"));
$dinding_tl = mysql_query($query_dinding_tl, $sepolwan_connect) or die(mysql_error());
$row_dinding_tl = mysql_fetch_assoc($dinding_tl);
$totalRows_dinding_tl = mysql_num_rows($dinding_tl);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php do { ?>
  <a href="#"><?php echo $row_mention['komentar']; ?></a><br />
<?php echo $row_kmnblog['komentar']; ?><br />
<?php echo substr($row_dinding_tl['isi'],0,255); ?><br />
<br />
<br />

  <?php } while ($row_mention = mysql_fetch_assoc($mention) or $row_dinding_tl = mysql_fetch_assoc($dinding_tl) or $row_kmnblog = mysql_fetch_assoc($kmnblog) ); ?>
</body>
</html>
<?php
mysql_free_result($mention);

mysql_free_result($kmnblog);

mysql_free_result($dinding_tl);
?>
